package designpattern.factory;

public class OperationFactory {
	//工厂类根据实际的操作来获取对象
	
	public static Double getResult(Double num1,Double num2,String opeatSign){
		switch (opeatSign) {
		case "+":
			return new OperationAdd(num1,num2).operat();
		
		case "-":
			return new OperationSub(num1,num2).operat();
			
		case "*":
			
			return new OperationMult(num1,num2).operat();
		case "/":
			
			return new OperationDiv(num1,num2).operat();
			
		default:
			System.out.println("目前不支持的运算，等待更新！");
			break;
		}
		return null;
		
		
		
	}
	
	
	
	

}
